package com.atguigu.gmall.feign.cart;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.model.cart.CartItem;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient("service-cart")
@RequestMapping("/rpc/inner/cart")
public interface CartFeignClient {

    @GetMapping("/addCart/{skuId}")
    public Result<CartItem> addSkuToCart(@PathVariable("skuId") Long skuId,
                                         @RequestParam Integer skuNum);

    @GetMapping("/deleteChecked")
    public Result deleteChecked();

    @GetMapping("/getCartItemChecked")
    public Result<List<CartItem>> getCartItemForOrderVo();
}
